package org.jaronsource.framework.util;

import org.joda.time.DateTime;

public class DateUtils extends org.apache.commons.lang.time.DateUtils {

	public static final String PATTERN_DATE = "yyyyMMdd";

	public static final String PATTERN_YEARMONTH = "yyyyMM";

	public static final String PATTERN_DATETIME = "yyyyMMdd HH:mm:ss";

	public static final String PATTERN_DATE_EXT = "yyyy-MM-dd";

	public static final String PATTERN_YEARMONTH_EXT = "yyyy-MM";

	public static final String PATTERN_DATETIME_EXT = "yyyy-MM-dd HH:mm:ss";

	public static final String format( DateTime dateTime, String pattern ) {
		return dateTime.toString( pattern );
	}

	public static final String currentYearMonth() {
		return format( new DateTime(), PATTERN_YEARMONTH );
	}

	public static final String currentDate() {
		return format( new DateTime(), PATTERN_DATE );
	}

	public static final String currentDateTime() {
		return format( new DateTime(), PATTERN_DATETIME );
	}

	public static final String currentYearMonthExt() {
		return format( new DateTime(), PATTERN_YEARMONTH_EXT );
	}

	public static final String currentDateExt() {
		return format( new DateTime(), PATTERN_DATE_EXT );
	}

	public static final String currentDateTimeExt() {
		return format( new DateTime(), PATTERN_DATETIME_EXT );
	}

}
